TimeZone

TimeZone

am 08.08.2005 12:05:48 von KH

Hi,
There is a request from mgmt, when user browse the request (web), the
database will return the requested timestamp at their timezone that
previously posted. How do i do that? Do I need store whole country codes
together timezones in database mysql ? Is there any way to find full
country code together with their timezone?


Cheers
KH


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/mysql?unsub=gcdmg-mysql@m.gmane.org

Re: TimeZone

am 09.08.2005 01:39:13 von Joseph Cochran

Some countries have multiple timezones, so it is not sufficient to
know the country code in order to get the timezone. If they have
previously posted the timezone, however, then it should be possible to
store that information in a cookie on the client machine that your web
layer can retrieve. If you want to permanently tie a timezone to a
user (assuming that this is an internal system or other system to
which your users authenticate -- if it is a public website you're
going to have to use cookies), simply include an extra column in the
user's record that has a number that stores its differential from GMT
(so the USA east coast would be -5) and save all of your data in GMT,
applying the timezone column to the time via datetime functions either
in the query or in your web layer.

-- Joe

On 8/8/05, KH wrote:
> Hi,
> There is a request from mgmt, when user browse the request (web), the
> database will return the requested timestamp at their timezone that
> previously posted. How do i do that? Do I need store whole country codes
> together timezones in database mysql ? Is there any way to find full
> country code together with their timezone?
>=20
>=20
> Cheers
> KH
>=20
>=20
> --
> MySQL General Mailing List
> For list archives: http://lists.mysql.com/mysql
> To unsubscribe: http://lists.mysql.com/mysql?unsub=3Dg.jsciv@gmail.com
>=20
>

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/mysql?unsub=3Dgcdmg-mysql@m.gmane.org

Re: TimeZone

am 09.08.2005 08:47:42 von Jigal van Hemert

Joseph Cochran wrote:
> Some countries have multiple timezones, so it is not sufficient to
> know the country code in order to get the timezone. If they have
> previously posted the timezone, however, then it should be possible to
> store that information in a cookie on the client machine that your web
> layer can retrieve. If you want to permanently tie a timezone to a
> user (assuming that this is an internal system or other system to
> which your users authenticate -- if it is a public website you're
> going to have to use cookies), simply include an extra column in the
> user's record that has a number that stores its differential from GMT
> (so the USA east coast would be -5) and save all of your data in GMT,
> applying the timezone column to the time via datetime functions either
> in the query or in your web layer.

One more complication: daylight savings time are not the same world
wide. So I would store the time zone and not the difference with GMT.

I personally would do al the time zone calculations in the web layer.
Most OSs have libraries with more or less knowledge about daylight
savings in various countries/timezones. Using the functions in the
language of the web layer you're more likely to get things right.

Regards, Jigal.

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/mysql?unsub=gcdmg-mysql@m.gmane.org

Re: timezone

am 03.06.2011 11:17:44 von John Daisley

--0016368342d1f7964004a4cb3926
Content-Type: text/plain; charset=windows-1252
Content-Transfer-Encoding: quoted-printable

Have you populated the timezone tables? Run this query if you are not sure.

*SELECT COUNT(*) FROM mysql.time_zone_name;*
*
*
***If it returns 0 then you need to populate the them as per the
instructions here
http://dev.mysql.com/doc/refman/5.5/en/time-zone-support.htm l*

Default timezone in mysql is set at server startup to SYSTEM, which means s=
o
long as your system clock is correct the MySQL server should be correct.


*
*
On 3 June 2011 09:55, Rocio Gomez Escribano
wrote:

> Hello! I=92m having trouble with timezones.
>
>
>
> I=92m in Spain, we have 2 different timezone now we are in GMT+2, in wint=
er,
> this is the GMT+1.
>
>
>
> I=92m looking for an instruction which give me the current timezone, but =
I
> cant find it! Do you know how can I now it?
>
>
>
> Thanks!
>
>
>
> *Roc=EDo G=F3mez Escribano*
>
> r.gomez@ingenia-soluciones.com
>
>
>
> [image: Descripci=F3n: cid:image002.jpg@01CB8CB6.ADEBA830]
>
> Pol=EDgono Campollano C/F, n=BA21T
>
> 02007 Albacete (Espa=F1a)
>
> Tlf:967-504-513 Fax: 967-504-513
>
> www.ingenia-soluciones.com
>
>
>



--=20
John Daisley

Certified MySQL 5 Database Administrator
Certified MySQL 5 Developer
Cognos BI Developer

Telephone: +44 (0)7918 621621
Email: john.daisley@butterflysystems.co.uk

--0016368342d1f7964004a4cb3926--

RE: timezone

am 03.06.2011 11:27:52 von Rocio Gomez Escribano

------=_NextPart_000_0021_01CC21E1.47AD7510
Content-Type: multipart/alternative;
boundary="----=_NextPart_001_0022_01CC21E1.47AD7510"


------=_NextPart_001_0022_01CC21E1.47AD7510
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

I=92m afraid I don’’t understand you:

=20

=20

mysql> select count(*) from mysql.time_zone_name;

+----------+

| count(*) |

+----------+

| 0 |

+----------+

1 row in set (0.00 sec)

=20

But, when I execute:

=20

=20

mysql> select now();

+---------------------+

| now() |

+---------------------+

| 2011-06-03 11:28:00 |

+---------------------+

1 row in set (0.00 sec)

=20

That=92s correct, in Spain it=92s that time. So, mysql is using the =
timezone
correctly, isn=92t it?

=20

Thanks!

=20

Roc=EDo G=F3mez Escribano

=
r.gomez@ingenia-soluciones.com

=20

Descripci=F3n: cid:image002.jpg@01CB8CB6.ADEBA830

Pol=EDgono Campollano C/F, n=BA21T

02007 Albacete (Espa=F1a)

Tlf:967-504-513 Fax: 967-504-513

www.ingenia-soluciones.com

=20

De: John Daisley [mailto:daisleyjohn@googlemail.com]=20
Enviado el: viernes, 03 de junio de 2011 11:18
Para: Rocio Gomez Escribano
CC: mysql@lists.mysql.com
Asunto: Re: timezone

=20

Have you populated the timezone tables? Run this query if you are not =
sure.

=20

SELECT COUNT(*) FROM mysql.time_zone_name;

=20

If it returns 0 then you need to populate the them as per the =
instructions
here http://dev.mysql.com/doc/refman/5.5/en/time-zone-support.htm l

=20

Default timezone in mysql is set at server startup to SYSTEM, which =
means so
long as your system clock is correct the MySQL server should be correct.

=20

=20

=20

On 3 June 2011 09:55, Rocio Gomez Escribano =

wrote:

Hello! I=92m having trouble with timezones.

=20

I=92m in Spain, we have 2 different timezone now we are in GMT+2, in =
winter,
this is the GMT+1.

=20

I=92m looking for an instruction which give me the current timezone, but =
I
cant find it! Do you know how can I now it?

=20

Thanks!

=20

Roc=EDo G=F3mez Escribano

r.gomez@ingenia-soluciones.com =


=20

=A1Error! Nombre de archivo no especificado.

Pol=EDgono Campollano C/F, n=BA21T

02007 Albacete (Espa=F1a)

Tlf:967-504-513 Fax: 967-504-513

www.ingenia-soluciones.com

=20




--=20
John Daisley

Certified MySQL 5 Database Administrator
Certified MySQL 5 Developer
Cognos BI Developer

Telephone: +44 (0)7918 621621
Email: john.daisley@butterflysystems.co.uk


------=_NextPart_001_0022_01CC21E1.47AD7510
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

charset=3Diso-8859-1">
xmlns:o=3D"urn:schemas-microsoft-com:office:office" =
xmlns:w=3D"urn:schemas-microsoft-com:office:word" =
xmlns:m=3D"http://schemas.microsoft.com/office/2004/12/omml" =
xmlns=3D"http://www.w3.org/TR/REC-html40"> content=3D"Microsoft Word 12 (filtered medium)"> vlink=3Dpurple>

name=3D"_MailEndCompose"> style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif" ;color:#1F497=
D'>I’m afraid I don’’t understand =
you:

style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif" ;color:#1F497=
D'> 

style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif" ;color:#1F497=
D'> 

style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif" ;color:#1F497=
D'>mysql> select count(*) from =
mysql.time_zone_name;

lang=3DEN-US =
style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif" ;color:#1F497=
D'>+----------+

lang=3DEN-US =
style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif" ;color:#1F497=
D'>| count(*) |

lang=3DEN-US =
style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif" ;color:#1F497=
D'>+----------+

lang=3DEN-US =
style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif" ;color:#1F497=
D'>|      =A0 0 |

class=3DMsoNormal> style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif" ;color:#1F497=
D'>+----------+

lang=3DEN-US =
style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif" ;color:#1F497=
D'>1 row in set (0.00 sec)

class=3DMsoNormal> style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif" ;color:#1F497=
D'> 

style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif" ;color:#1F497=
D'>But, when I execute:

lang=3DEN-US =
style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif" ;color:#1F497=
D'> 

style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif" ;color:#1F497=
D'> 

style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif" ;color:#1F497=
D'>mysql> select now();

class=3DMsoNormal> style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif" ;color:#1F497=
D'>+---------------------+

class=3DMsoNormal> style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif" ;color:#1F497=
D'>| now()               =
|

style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif" ;color:#1F497=
D'>+---------------------+

class=3DMsoNormal> style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif" ;color:#1F497=
D'>| 2011-06-03 11:28:00 |

class=3DMsoNormal> style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif" ;color:#1F497=
D'>+---------------------+

class=3DMsoNormal> style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif" ;color:#1F497=
D'>1 row in set (0.00 sec)

class=3DMsoNormal> style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif" ;color:#1F497=
D'> 

style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif" ;color:#1F497=
D'>That’s correct, in Spain it’s that time. So, mysql is =
using the timezone correctly, isn’t it?

class=3DMsoNormal> style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif" ;color:#1F497=
D'> 

style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif" ;color:#1F497=
D'>Thanks!

style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif" ;color:#1F497=
D'> 

lang=3DES-PE =
style=3D'font-size:10.0pt;font-family:"Calibri","sans-serif" ;color:#0070C=
0'>Roc=EDo G=F3mez Escribano

class=3DMsoNormal> href=3D"mailto:r.sanchez@ingenia-soluciones.com"> style=3D'font-size:10.0pt;font-family:"Calibri","sans-serif" '>r.gomez@ing=
enia-soluciones.com
style=3D'font-size:10.0pt;font-family:"Calibri","sans-serif" ;color:#9D9D9=
D'>

style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif" ;color:blue'>=
 

style=3D'font-size:9.0pt;font-family:"Calibri","sans-serif"; color:#9D9D9D=
'> src=3D"cid:image001.jpg@01CC21E1.46848570" alt=3D"Descripci=F3n: =
cid:image002.jpg@01CB8CB6.ADEBA830">
style=3D'font-family:"Calibri","sans-serif";color:blue'> >

style=3D'font-size:10.0pt;font-family:"Calibri","sans-serif" ;color:#A6A6A=
6'>Pol=EDgono Campollano C/F, n=BA21T
style=3D'font-size:10.0pt;font-family:"Calibri","sans-serif" ;color:blue'>=

style=3D'font-size:10.0pt;font-family:"Calibri","sans-serif" ;color:#9D9D9=
D'>02007 Albacete (Espa=F1a)

class=3DMsoNormal> style=3D'font-size:10.0pt;font-family:"Calibri","sans-serif" ;color:#9D9D9=
D'>Tlf:967-504-513  Fax: 967-504-513

class=3DMsoNormal> title=3D"blocked::www.ingenia-soluciones.com"> style=3D'font-size:10.0pt;font-family:"Calibri","sans-serif" ;color:#9D9D9=
D'>www.ingenia-soluciones.com
style=3D'font-size:10.0pt;font-family:"Calibri","sans-serif" ;color:#A6A6A=
6'>

style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif" ;color:#1F497=
D'> 

style=3D'border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm =
0cm 0cm'>

style=3D'font-size:10.0pt;font-family:"Tahoma","sans-serif"' >De: b> =
John Daisley [mailto:daisleyjohn@googlemail.com]
Enviado el: =
viernes, 03 de junio de 2011 11:18
Para: Rocio Gomez =
Escribano
CC: mysql@lists.mysql.com
Asunto: Re: =
timezone

class=3DMsoNormal> 

Have you =
populated the timezone tables? Run this query if you are not =
sure.

class=3DMsoNormal> 

class=3DMsoNormal>SELECT =
COUNT(*) FROM =
mysql.time_zone_name;

class=3DMsoNormal> 

class=3DMsoNormal>If it =
returns 0 then you need to populate the them as per the instructions =
here  href=3D"http://dev.mysql.com/doc/refman/5.5/en/time-zone-sup port.html">ht=
tp://dev.mysql.com/doc/refman/5.5/en/time-zone-support.html
>

class=3DMsoNormal> 

class=3DMsoNormal>Default timezone in mysql is set at server startup to =
SYSTEM, which means so long as your system clock is correct the MySQL =
server should be correct.

class=3DMsoNormal> 

class=3DMsoNormal> 

style=3D'margin-bottom:12.0pt'> 

class=3DMsoNormal>On 3 June 2011 09:55, Rocio Gomez Escribano < href=3D"mailto:r.gomez@ingenia-soluciones.com">r.gomez@ingen ia-soluciones=
..com
> wrote:

style=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt:auto' > lang=3DEN-US>Hello! I’m having trouble with =
timezones.

style=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt:auto' > lang=3DEN-US> 

style=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt:auto' > lang=3DEN-US>I’m in Spain, we have 2 different timezone now we are =
in GMT+2, in winter, this is the GMT+1.

class=3DMsoNormal =
style=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt:auto' > lang=3DEN-US> 

style=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt:auto' > lang=3DEN-US>I’m looking for an instruction which give me the =
current timezone, but I cant find it! Do you know how can I now =
it?

style=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt:auto' > lang=3DEN-US> 

style=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt:auto' > lang=3DEN-US>Thanks!

style=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt:auto' > lang=3DEN-US> 

style=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt:auto' > lang=3DES-PE style=3D'font-size:10.0pt;color:#0070C0'>Roc=EDo G=F3mez =
Escribano

style=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt:auto' > lang=3DES-PE style=3D'font-size:10.0pt;color:#9D9D9D'> href=3D"mailto:r.sanchez@ingenia-soluciones.com" =
target=3D"_blank">r.gomez@ingenia-soluciones.com
>

style=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt:auto' > style=3D'color:blue'> 

style=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt:auto' > style=3D'font-size:9.0pt;color:#9D9D9D'>=A1Error! Nombre de archivo =
no especificado.

style=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt:auto' > style=3D'font-size:10.0pt;color:#A6A6A6'>Pol=EDgono Campollano C/F, =
n=BA21T

style=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt:auto' > style=3D'font-size:10.0pt;color:#9D9D9D'>02007 Albacete =
(Espa=F1a)

style=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt:auto' > lang=3DEN-GB =
style=3D'font-size:10.0pt;color:#9D9D9D'>Tlf:967-504-513  Fax: =
967-504-513

style=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt:auto' > style=3D'font-size:10.0pt;color:#A6A6A6'> href=3D"http://www.ingenia-soluciones.com" target=3D"_blank" =
title=3D"blocked::www.ingenia-soluciones.com"> style=3D'color:#9D9D9D'>www.ingenia-soluciones.com
=

style=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt:auto' > lang=3DEN-US> 

class=3DMsoNormal>


--
John =
Daisley

Certified MySQL 5 Database Administrator
Certified =
MySQL 5 Developer
Cognos BI Developer

Telephone: +44 (0)7918 =
621621
Email: href=3D"mailto:john.daisley@butterflysystems.co.uk">john.dai sley@butterfl=
ysystems.co.uk


------=_NextPart_001_0022_01CC21E1.47AD7510--

------=_NextPart_000_0021_01CC21E1.47AD7510--

Re: timezone

am 03.06.2011 12:08:34 von John Daisley

--00163683415ebee6fa04a4cbef1e
Content-Type: multipart/alternative; boundary=00163683415ebee6de04a4cbef1d

--00163683415ebee6de04a4cbef1d
Content-Type: text/plain; charset=windows-1252
Content-Transfer-Encoding: quoted-printable

now() returns the current system time which doesn't really have a great dea=
l
to do with time zones.

You can check what the current time zone is set to with the following
command

*show variables like 'time_zone';*

but that is likely to return the value '*SYSTEM*' which means it takes the
value from the host operating system ( usually set in /etc/timezone ).

You can set the time_zone variable either globally or per session to an
offset of UTC as follows

*SET time_zone=3D'+00:00:00';*
*SET GLOBAL time_zone=3D'+00:00:00';*

Or you can specify a '*default_time_zone*' in your my.cnf/my.ini options
file.

You can also set the time_zone variables to a named offset which will then
take account of daylight savings times but to do this you must first load
the mysql time zone tables.

I strongly suggest you read the manual section relating to time zone suppor=
t
which you can find here

http://dev.mysql.com/doc/refman/5.5/en/time-zone-support.htm l



On 3 June 2011 10:27, Rocio Gomez Escribano
wrote:

> I=92m afraid I don’’t understand you:
>
>
>
>
>
> mysql> select count(*) from mysql.time_zone_name;
>
> +----------+
>
> | count(*) |
>
> +----------+
>
> | 0 |
>
> +----------+
>
> 1 row in set (0.00 sec)
>
>
>
> But, when I execute:
>
>
>
>
>
> mysql> select now();
>
> +---------------------+
>
> | now() |
>
> +---------------------+
>
> | 2011-06-03 11:28:00 |
>
> +---------------------+
>
> 1 row in set (0.00 sec)
>
>
>
> That=92s correct, in Spain it=92s that time. So, mysql is using the timez=
one
> correctly, isn=92t it?
>
>
>
> Thanks!
>
>
>
> *Roc=EDo G=F3mez Escribano*
>
> r.gomez@ingenia-soluciones.com
>
>
>
> [image: Descripci=F3n: cid:image002.jpg@01CB8CB6.ADEBA830]
>
> Pol=EDgono Campollano C/F, n=BA21T
>
> 02007 Albacete (Espa=F1a)
>
> Tlf:967-504-513 Fax: 967-504-513
>
> www.ingenia-soluciones.com
>
>
>
> *De:* John Daisley [mailto:daisleyjohn@googlemail.com]
> *Enviado el:* viernes, 03 de junio de 2011 11:18
> *Para:* Rocio Gomez Escribano
> *CC:* mysql@lists.mysql.com
> *Asunto:* Re: timezone
>
>
>
> Have you populated the timezone tables? Run this query if you are not sur=
e.
>
>
>
> *SELECT COUNT(*) FROM mysql.time_zone_name;*
>
>
>
> *If it returns 0 then you need to populate the them as per the
> instructions here
> http://dev.mysql.com/doc/refman/5.5/en/time-zone-support.htm l*
>
>
>
> Default timezone in mysql is set at server startup to SYSTEM, which means
> so long as your system clock is correct the MySQL server should be correc=
t.
>
>
>
>
>
>
>
> On 3 June 2011 09:55, Rocio Gomez Escribano <
> r.gomez@ingenia-soluciones.com> wrote:
>
> Hello! I=92m having trouble with timezones.
>
>
>
> I=92m in Spain, we have 2 different timezone now we are in GMT+2, in wint=
er,
> this is the GMT+1.
>
>
>
> I=92m looking for an instruction which give me the current timezone, but =
I
> cant find it! Do you know how can I now it?
>
>
>
> Thanks!
>
>
>
> *Roc=EDo G=F3mez Escribano*
>
> r.gomez@ingenia-soluciones.com
>
>
>
> *=A1Error! Nombre de archivo no especificado.*
>
> Pol=EDgono Campollano C/F, n=BA21T
>
> 02007 Albacete (Espa=F1a)
>
> Tlf:967-504-513 Fax: 967-504-513
>
> www.ingenia-soluciones.com
>
>
>
>
>
>
> --
> John Daisley
>
> Certified MySQL 5 Database Administrator
> Certified MySQL 5 Developer
> Cognos BI Developer
>
> Telephone: +44 (0)7918 621621
> Email: john.daisley@butterflysystems.co.uk
>



--=20
John Daisley
Butterfly Information Systems

Microsoft SQL Server Database Administrator
Certified MySQL 5 Database Administrator & Developer
Cognos BI Developer \ Administrator

Available for short & long term contracts

Telephone: +44 (0)7918 621621
Email: john.daisley@butterflysystems.co.uk

--00163683415ebee6de04a4cbef1d
Content-Type: text/html; charset=windows-1252
Content-Transfer-Encoding: quoted-printable

now() returns the current system time which doesn't really have a great=
deal to do with time zones.


You can check what the curr=
ent time zone is set to with the following command

sh=
ow variables like 'time_zone';



but that is likely to return the value 'SYSTEM i>' which means it takes the value from the host operating system ( usu=
ally set in /etc/timezone ).=A0

You can set the ti=
me_zone variable either globally or per session to an offset of UTC as foll=
ows


SET time_zone=3D'+00:00:00';
<=
i>SET GLOBAL time_zone=3D'+00:00:00';

=
Or you can specify a 'default_time_zone' in your my.cnf/my.i=
ni options file.


You can also set the time_zone variables to a named off=
set which will then take account of daylight savings times but to do this y=
ou must first load the mysql time zone tables.=A0


I strongly suggest you read the manual section relating to time zone suppor=
t which you can find here=A0




_quote">On 3 June 2011 10:27, Rocio Gomez Escribano <<=
a href=3D"mailto:r.gomez@ingenia-soluciones.com">r.gomez@ingen ia-soluciones=
..com>
wrote:

x #ccc solid;padding-left:1ex;">

> "font-size:11.0pt;color:#1F497D">I=92m afraid I don’’t understand you:<=
/span>


=A0 >

r:#1F497D">=A0

=3D"font-size:11.0pt;color:#1F497D">mysql> select count(*) from mysql.ti=
me_zone_name;


:#1F497D">+----------+

" style=3D"font-size:11.0pt;color:#1F497D">| count(*) |

=3D"MsoNormal">
+----------+<=
/span>

..0pt;color:#1F497D">|      =A0 0 |

mal">+-------=
---+


:#1F497D">1 row in set (0.00 sec)

ng=3D"EN-US" style=3D"font-size:11.0pt;color:#1F497D">=A0

s=3D"MsoNormal">
But, when I e=
xecute:

-size:11.0pt;color:#1F497D">=A0

=3D"EN-US" style=3D"font-size:11.0pt;color:#1F497D">=A0


:#1F497D">mysql> select now();

ng=3D"EN-US" style=3D"font-size:11.0pt;color:#1F497D">+------------------ --=
-+


:#1F497D">| now()               |

class=3D"MsoNormal"> F497D">+---------------------+


:#1F497D">| 2011-06-03 11:28:00 |

ng=3D"EN-US" style=3D"font-size:11.0pt;color:#1F497D">+------------------ --=
-+


:#1F497D">1 row in set (0.00 sec)

ng=3D"EN-US" style=3D"font-size:11.0pt;color:#1F497D">=A0

s=3D"MsoNormal">
That=92s corr=
ect, in Spain it=92s that time. So, mysql is using the timezone correctly, =
isn=92t it?

=3D"EN-US" style=3D"font-size:11.0pt;color:#1F497D">=A0


:#1F497D">Thanks!

le=3D"font-size:11.0pt;color:#1F497D">=A0

=
Roc=EDo G=
=F3mez Escribano


target=3D"_blank">r.gomez@i=
ngenia-soluciones.com
0pt;color:#9D9D9D">


=A0 n>

=
1E1.46848570" alt=3D"Descripci=F3n: cid:image002.jpg@01CB8CB6.ADEBA830"> pan>


Pol=
=EDgono Campollano C/F, n=BA21T
:blue">

lor:#9D9D9D">02007 Albacete (Espa=F1a)


:#9D9D9D">Tlf:967-504-513=A0 Fax: 967-504-513

al"> enia-soluciones.com" target=3D"_blank"> ize:10.0pt;color:#9D9D9D">www.ingenia-soluciones.com =3D"EN-GB" style=3D"font-size:10.0pt;color:#A6A6A6">


:#1F497D">=A0

5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm">

e=3D"font-size:10.0pt">De: John=
Daisley [mailto: lank">daisleyjohn@googlemail.com]

Enviado el: viernes, 03 de junio de 2011 11:18
Para: Rocio=
Gomez Escribano
CC: get=3D"_blank">mysql@lists.mysql.com
Asunto: Re: timezone an>


=A0

">Have you populated the timezone tables?=A0Run this query if you are not s=
ure.

=A0

">SELECT COUNT(*) FROM mysql.time=
_zone_name;


=A0

=A0

=
Default timezone in mysql is set at server startup to SYSTEM, which means s=
o long as your system clock is correct the MySQL server should be correct.<=
/p>

=A0

=
=A0

t">=A0

On 3 June 2011 09:5=
5, Rocio Gomez Escribano < om" target=3D"_blank">r.gomez@ingenia-soluciones.com> wrote:


S">Hello! I=92m having trouble with timezones.

mal">=A0

=3D"EN-US">I=92m in Spain, we have 2 different timezone now we are in GMT+2=
, in winter, this is the GMT+1.


=A0

rmal">I=92m looking for an instruction which give me t=
he current timezone, but I cant find it! Do you know how can I now it? n>


=A0

US">Thanks!

=A0 >

pt;color:#0070C0">Roc=EDo G=F3mez Escribano


:#9D9D9D"> ank">r.gomez@ingenia-soluciones.com

pan style=3D"color:blue">=A0


=
=A1Error! Nombre de archivo no especificado.

"im">

=
Pol=EDgono Campollano C/F, n=BA21T


02007=
Albacete (Espa=F1a)

style=3D"font-size:10.0pt;color:#9D9D9D">Tlf:967-504-513=A0 Fax: 967-504-51=
3


ef=3D"http://www.ingenia-soluciones.com" title=3D"blocked::www.ingenia-solu=
ciones.com" target=3D"_blank">=
www.ingenia-soluciones.com


=A0

>




-=
-
John Daisley

Certified MySQL 5 Database Administrator
Certi=
fied MySQL 5 Developer

Cognos BI Developer

Telephone: +44 (0)7918 621621
Email: =3D"mailto:john.daisley@butterflysystems.co.uk" target=3D"_blank">john.dais=
ley@butterflysystems.co.uk

v>



--
John Daisley
Butterfly Information Sys=
tems

Microsoft SQL Server Database Administrator
Certified MySQL=
5 Database Administrator & Developer
Cognos BI Developer \ Administ=
rator=A0


Available for short & long term contracts





--00163683415ebee6de04a4cbef1d--
--00163683415ebee6fa04a4cbef1e--

Re: timezone

am 03.06.2011 12:37:52 von Johan De Meersman

--=_2f030fdb-d654-4a5e-ad31-56d3472bbe44
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 7bit

I would also like to point out, as an aside, that Spain doesn't actually have two timezones - it has a single timezone with daylight savings time. The real question is, thus, to figure out wether or not you are on DST or not.

That, however, I have no idea how to do - the system takes care of it automagically. I'm not even sure it gets tracked somewhere on the system, you might need to download and parse the rules yourself in your code.

Unless, of course, you're talking about the timezone difference between Spain and the Canaries, but you mentioned summer/winter time explicitly, so I don't think so.

----- Original Message -----

> From: "John Daisley"
> To: "Rocio Gomez Escribano"
> Cc: mysql@lists.mysql.com
> Sent: Friday, 3 June, 2011 12:08:34 PM
> Subject: Re: timezone

> now() returns the current system time which doesn't really have a
> great deal to do with time zones.

> You can check what the current time zone is set to with the following
> command

> show variables like 'time_zone';

> but that is likely to return the value ' SYSTEM ' which means it
> takes the value from the host operating system ( usually set in
> /etc/timezone ).

> You can set the time_zone variable either globally or per session to
> an offset of UTC as follows

> SET time_zone='+00:00:00';
> SET GLOBAL time_zone='+00:00:00';

> Or you can specify a ' default_time_zone ' in your my.cnf/my.ini
> options file.

> You can also set the time_zone variables to a named offset which will
> then take account of daylight savings times but to do this you must
> first load the mysql time zone tables.

> I strongly suggest you read the manual section relating to time zone
> support which you can find here

> http://dev.mysql.com/doc/refman/5.5/en/time-zone-support.htm l

> On 3 June 2011 10:27, Rocio Gomez Escribano <
> r.gomez@ingenia-soluciones.com > wrote:

--
Bier met grenadyn
Is als mosterd by den wyn
Sy die't drinkt, is eene kwezel
Hy die't drinkt, is ras een ezel

--=_2f030fdb-d654-4a5e-ad31-56d3472bbe44--

Re: timezone

am 03.06.2011 12:43:29 von John Daisley

--0016368342d19dcf6604a4cc6c49
Content-Type: text/plain; charset=ISO-8859-1

To take account of daylight savings time in MySQL, load the time zone tables
and set the `default_time_zone` variable to the named time zone for your
country.


On 3 June 2011 11:37, Johan De Meersman wrote:

> I would also like to point out, as an aside, that Spain doesn't actually
> have two timezones - it has a single timezone with daylight savings time.
> The real question is, thus, to figure out wether or not you are on DST or
> not.
>
> That, however, I have no idea how to do - the system takes care of it
> automagically. I'm not even sure it gets tracked somewhere on the system,
> you might need to download and parse the rules yourself in your code.
>
> Unless, of course, you're talking about the timezone difference between
> Spain and the Canaries, but you mentioned summer/winter time explicitly, so
> I don't think so.
>
>
> ------------------------------
>
> *From: *"John Daisley"
> *To: *"Rocio Gomez Escribano"
> *Cc: *mysql@lists.mysql.com
> *Sent: *Friday, 3 June, 2011 12:08:34 PM
> *Subject: *Re: timezone
>
>
> now() returns the current system time which doesn't really have a great
> deal to do with time zones.
>
> You can check what the current time zone is set to with the following
> command
>
> *show variables like 'time_zone';*
>
> but that is likely to return the value '*SYSTEM*' which means it takes the
> value from the host operating system ( usually set in /etc/timezone ).
>
> You can set the time_zone variable either globally or per session to an
> offset of UTC as follows
>
> *SET time_zone='+00:00:00';*
> *SET GLOBAL time_zone='+00:00:00';*
>
> Or you can specify a '*default_time_zone*' in your my.cnf/my.ini options
> file.
>
> You can also set the time_zone variables to a named offset which will then
> take account of daylight savings times but to do this you must first load
> the mysql time zone tables.
>
> I strongly suggest you read the manual section relating to time zone
> support which you can find here
>
> http://dev.mysql.com/doc/refman/5.5/en/time-zone-support.htm l
>
>
>
> On 3 June 2011 10:27, Rocio Gomez Escribano <
> r.gomez@ingenia-soluciones.com> wrote:
>
>
>
>
>
> --
> Bier met grenadyn
> Is als mosterd by den wyn
> Sy die't drinkt, is eene kwezel
> Hy die't drinkt, is ras een ezel
>



--
John Daisley
Butterfly Information Systems

Microsoft SQL Server Database Administrator
Certified MySQL 5 Database Administrator & Developer
Cognos BI Developer \ Administrator

Available for short & long term contracts

Telephone: +44 (0)7918 621621
Email: john.daisley@butterflysystems.co.uk

--0016368342d19dcf6604a4cc6c49--

RE: timezone

am 03.06.2011 16:45:25 von Jerry Schwartz

------=_NextPart_000_0089_01CC21DB.5CF13D90
Content-Type: text/plain;
charset="utf-8"
Content-Transfer-Encoding: quoted-printable

From: John Daisley [mailto:daisleyjohn@googlemail.com]=20
Sent: Friday, June 03, 2011 6:09 AM
To: Rocio Gomez Escribano
Cc: mysql@lists.mysql.com
Subject: Re: timezone

=20

now() returns the current system time which doesn't really have a great =
deal to do with time zones.

=20

[JS] I think that statement is confusing â€=93 at least, it is to =
me. Unless you specify otherwise, NOW() returns the current system time =
in the systemâ€=99s time zone. Your comment could be interpreted to =
mean that it doesnâ€=99t use any time zone: i.e., that it returns =
the UTC.

=20

=20

Regards,

=20

Jerry Schwartz

Global Information Incorporated

195 Farmington Ave.

Farmington, CT 06032

=20

860.674.8796 / FAX: 860.674.8341

E-mail: jerry@gii.co.jp=20

Web site: www.the-infoshop.com =20

=20

=20

=20

You can check what the current time zone is set to with the following =
command

=20

show variables like 'time_zone';

=20

but that is likely to return the value 'SYSTEM' which means it takes the =
value from the host operating system ( usually set in /etc/timezone ).=20

=20

You can set the time_zone variable either globally or per session to an =
offset of UTC as follows

=20

SET time_zone=3D'+00:00:00';

SET GLOBAL time_zone=3D'+00:00:00';

=20

Or you can specify a 'default_time_zone' in your my.cnf/my.ini options =
file.

=20

You can also set the time_zone variables to a named offset which will =
then take account of daylight savings times but to do this you must =
first load the mysql time zone tables.=20

=20

I strongly suggest you read the manual section relating to time zone =
support which you can find here=20

=20

http://dev.mysql.com/doc/refman/5.5/en/time-zone-support.htm l

=20

=20

=20

On 3 June 2011 10:27, Rocio Gomez Escribano =
wrote:

Iâ€=99m afraid I don’’t understand you:

=20

=20

mysql> select count(*) from mysql.time_zone_name;

+----------+

| count(*) |

+----------+

| 0 |

+----------+

1 row in set (0.00 sec)

=20

But, when I execute:

=20

=20

mysql> select now();

+---------------------+

| now() |

+---------------------+

| 2011-06-03 11:28:00 |

+---------------------+

1 row in set (0.00 sec)

=20

Thatâ€=99s correct, in Spain itâ€=99s that time. So, mysql is =
using the timezone correctly, isnâ€=99t it?

=20

Thanks!

=20

Rocío Gómez Escribano

=
r.gomez@ingenia-soluciones.com

=20

Descripción: cid:image002.jpg@01CB8CB6.ADEBA830

Polígono Campollano C/F, nº21T

02007 Albacete (España)

Tlf:967-504-513 Fax: 967-504-513

www.ingenia-soluciones.com

=20

De: John Daisley [mailto:daisleyjohn@googlemail.com]=20
Enviado el: viernes, 03 de junio de 2011 11:18
Para: Rocio Gomez Escribano
CC: mysql@lists.mysql.com
Asunto: Re: timezone

=20

Have you populated the timezone tables? Run this query if you are not =
sure.

=20

SELECT COUNT(*) FROM mysql.time_zone_name;

=20

If it returns 0 then you need to populate the them as per the =
instructions here =
http://dev.mysql.com/doc/refman/5.5/en/time-zone-support.htm l

=20

Default timezone in mysql is set at server startup to SYSTEM, which =
means so long as your system clock is correct the MySQL server should be =
correct.

=20

=20

=20

On 3 June 2011 09:55, Rocio Gomez Escribano =
wrote:

Hello! Iâ€=99m having trouble with timezones.

=20

Iâ€=99m in Spain, we have 2 different timezone now we are in GMT+2, =
in winter, this is the GMT+1.

=20

Iâ€=99m looking for an instruction which give me the current =
timezone, but I cant find it! Do you know how can I now it?

=20

Thanks!

=20

Rocío Gómez Escribano

r.gomez@ingenia-soluciones.com =


=20

¡Error! Nombre de archivo no especificado.

Polígono Campollano C/F, nº21T

02007 Albacete (España)

Tlf:967-504-513 Fax: 967-504-513

www.ingenia-soluciones.com

=20




--=20
John Daisley

Certified MySQL 5 Database Administrator
Certified MySQL 5 Developer
Cognos BI Developer

Telephone: +44 (0)7918 621621
Email: john.daisley@butterflysystems.co.uk




--=20
John Daisley

Butterfly Information Systems

Microsoft SQL Server Database Administrator

Certified MySQL 5 Database Administrator & Developer
Cognos BI Developer \ Administrator=20

Available for short & long term contracts


Telephone: +44 (0)7918 621621
Email: john.daisley@butterflysystems.co.uk

=20


------=_NextPart_000_0089_01CC21DB.5CF13D90--